package com.tjw.ec.upms.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.tjw.ec.common.core.util.PageUtils;
import com.tjw.ec.common.core.util.Query;
import com.tjw.ec.upms.api.entity.UserPermitEntity;
import com.tjw.ec.upms.dao.UserPermitDao;
import com.tjw.ec.upms.service.UserPermitService;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * 用户授权表
 *
 * @author T-junwen
 * @email t-junwen@foxmail.com
 * @date 2019-07-27 16:43:31
 */
@Service("userPermitService")
public class UserPermitServiceImpl extends ServiceImpl<UserPermitDao, UserPermitEntity> implements UserPermitService {

    @Override
    public PageUtils<UserPermitEntity> queryPage(Map<String, Object> params) {

        IPage<UserPermitEntity> page = new Query<UserPermitEntity>(params).getPage();

        QueryWrapper<UserPermitEntity> queryWrapper = new QueryWrapper<>();

        IPage<UserPermitEntity> data = baseMapper.selectPage(
                page,
                queryWrapper
        );

        return new PageUtils(data);
    }

}
